const Router = require('koa-router');
const router = new Router();
const { getUserList, register, getUserInfo, login } = require('../controller/users.controller');
const { userValidatorMiddleware, cryptoPasswordMiddleware, verifyLoginMiddleware, verifyRegisterMiddleware } = require('../middleware/user.middleware');
router.get('/', getUserList);
router.get('/info/:id', getUserInfo);
router.post('/login', userValidatorMiddleware(), cryptoPasswordMiddleware, verifyLoginMiddleware, login);
router.post('/register', userValidatorMiddleware(1), cryptoPasswordMiddleware, verifyRegisterMiddleware, register);

module.exports = router